<br />
<div>
    <% if (!isFirstPage) { %>
    <span class="prepage">
        <a title="上一页" href="?p=<%= page-1 %>">上一页</a>
        <a href="?p=<%= 1 %>">首页</a>
    </span>
    <% } %>
    <%for(var i = 0;i<slength;i++){%>
    <span class="page">
        <a href="?p=<%= i+1 %>"><%= i+1%></a>
    </span>
    <%}%>
    <% if (!isLastPage) { %>
    <span class="nextpage">
        <a title="下一页" href="?p=<%= page+1 %>">下一页</a>
        <a href="?p=<%= slength %>">尾页</a>
    </span>
    <% } %>
</div>
<script>
    $(function () {
       $('.page a').eq(<%= page-1%>).addClass('current').siblings().removeClass('current');
    });
</script>